import java.io.FileNotFoundException;

public class Test {
    public static void OpenConfig(String filename) throws FileNotFoundException {
        if (filename.equals("config.ini")) {
            throw new FileNotFoundException("配置⽂件名字不对");
        }
    }

    public static void main(String[] args) {
        try {
            int[] array = {1,2,3,4,5};
            array[100] = 100;
        }catch (NullPointerException nullPointerException){
            nullPointerException.printStackTrace();
        }catch (ArrayIndexOutOfBoundsException a){
            a.printStackTrace();
        }catch (RuntimeException runtimeException){
        runtimeException.printStackTrace();
    }

    public static void main1(String[] args) throws FileNotFoundException {
        //处理异常
        try{
            OpenConfig("config.ini");
        }catch(FileNotFoundException e){
            System.out.println("捕获到了 FileNotFoundException 异常... 开始处理异常");
            e.printStackTrace();
        }
        System.out.println("异常处理完毕，开始执行下一步");

    }
    }
